package com.cardone.platform.authority.service;

import java.util.List;
import java.util.Map;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import com.cardone.common.cache.support.CacheEvictSupport;
import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.platform.authority.dto.NavigationDto;

/**
 * 导航服务
 *
 * @author yaohaitao
 */
public interface NavigationService {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "com.cardone.platform.authority.service.NavigationService";

	/**
	 * 保存:导航
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param saveNavigation
	 *            导航对象
	 * 
	 * @return 导航对象
	 */
	@Deprecated
	@CacheEvict(value = NavigationService.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(Class<P> mappedClass, NavigationDto saveNavigation);

	/**
	 * 保存:导航
	 * 
	 * @param saveNavigation
	 *            导航对象
	 * 
	 * @return 导航对象
	 */
	@Deprecated
	@CacheEvict(value = NavigationService.BEAN_ID, allEntries = true)
	NavigationDto saveByIdOrCode(NavigationDto saveNavigation);

	/**
	 * 插入
	 * 
	 * @param insertNavigation
	 *            导航对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = NavigationService.BEAN_ID, allEntries = true)
	int insertByCode(NavigationDto insertNavigation);
	
	/**
	 * 删除
	 * 
	 * @param deleteNavigation
	 *            导航对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = NavigationService.BEAN_ID, allEntries = true)
	int deleteByIds(NavigationDto deleteNavigation);

	/**
	 * 更新
	 * 
	 * @param updateNavigation
	 *            导航对象
	 * 
	 * @return 影响行数
	 */
	@Deprecated
	@CacheEvict(value = NavigationService.BEAN_ID, allEntries = true)
	int updateByCode(NavigationDto updateNavigation);

	/**
	 * 查询
	 * 
	 * @param requiredType
	 *            返回类型
	 * 
	 * @param readNavigation
	 *            导航对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = NavigationService.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(NavigationDto readNavigation);
	
	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findNavigation
	 *            导航对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = NavigationService.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(Class<P> mappedClass, NavigationDto findNavigation);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findNavigation
	 *            导航对象
	 * 
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = NavigationService.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(Class<P> mappedClass, NavigationDto findNavigation);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param findListNavigation
	 *            导航对象
	 * 
	 * @return 导航对象集合
	 */
	@Deprecated
	@Cacheable(value = NavigationService.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(Class<P> mappedClass, NavigationDto findListNavigation);

	/**
	 * 查询
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @return 导航对象集合
	 */
	@Deprecated
	@Cacheable(value = NavigationService.BEAN_ID, key = Caches.KEY_1)
	<P> List<P> findList(Class<P> mappedClass);

	/**
	 * 分页
	 * 
	 * @param mappedClass
	 *            返回类型
	 * 
	 * @param paginationNavigation
	 *            导航对象
	 * 
	 * @return 导航分页对象
	 */
	@Deprecated
	@Cacheable(value = NavigationService.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, NavigationDto paginationNavigation);
}